package com.cpa.admin.service;

import com.cpa.admin.base.BaseService;
import com.cpa.admin.mapper.ProductMapper;
import com.cpa.admin.model.ProductDo;
import com.cpa.admin.vo.ProductVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @author zhen.zhao01
 * @CreateDate 2018/11/4
 */
@Slf4j
@Service
public class ProductService extends BaseService<ProductDo, ProductMapper> implements ProductMapper {


    @Override
    public List<ProductVo> findAllVo(String productName) {
        return mapper.findAllVo(StringUtils.isEmpty(productName)? null : "%" + productName + "%");
    }

    @Override
    public List<ProductVo> findIdAndName() {
        return mapper.findIdAndName();
    }
}
